home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / brklyprl.lha / Emulator / Tests / Passed / test13.pl < prev    next >
Encoding:
Text File  |  1989-04-14  |  264 b   |  10 lines

  1.  
  2. /* Copyright (C) 1988, 1989 Herve' Touati, Aquarius Project, UC Berkeley */
  3.  
  4. /* some arithmetic */
  5. main :- a(X), b(Y), c(Z), W is Z*Z - X*X - Y*Y, W == 0, write(ok), nl.
  6.  
  7. a(X) :- X is 1 + 1 + 1.
  8. b(Y) :- X is 1 + 1, Y is X + X.
  9. c(Z) :- X is 2, Y is 3, Z is X + Y.
  10.